<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, in1itial-scale=1.0">
    <script src="../js/vue.global.js"></script>
    <title>事件绑定</title>
</head>
<body>
    <div id="APP">
        <button @click="changeWebSite()">设置超链接为bing</button>
        <a :href="url">{{website}}</a>
    </div>

    <script>
        const {createApp} = Vue

        createApp({
            data()
            {
                return {
                    url:"https://www.baidu.com",
                    website:"百度"
                }
            },
            methods:{
                changeWebSite()
                {
                    this.url="https://www.bing.com",
                    this.website="必应"
                }

            }
        }).mount("#APP");
    </script>
</body>
</html>